package handlers;

import map.GameWorld;
import map.Position;
import inventory.Inventory;
import item.TakeableItem;
import pausing.Pauseable;
import entity.Entity;

public class InventoryHandler extends Pauseable {
	private Entity entity = null;
	
	public InventoryHandler(Entity iH) {
		this.entity = iH;
	}
	
	public void useItem(TakeableItem item) {
		item.accept(entity.getUseVisitor());
	}
	
	public void dropItem(TakeableItem item) {
	    Inventory inventory = entity.getInventory();
	    GameWorld.getInstance().getCurrentMap().addItem(inventory.removeItem(item), new Position(entity.getPosition()));
	}
}
